.\" Copyright (c) 2002-2020 Julien Nadeau Carriere <vedge@csoft.net>
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\"    notice, this list of conditions and the following disclaimer in the
.\"    documentation and/or other materials provided with the distribution.
.\" 
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
.\" INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
.\" (INCLUDING BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
.\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
.\" IN ANY WAY OUT OF THE USE OF THIS SOFTWARE EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
.Dd August 20, 2002
.Dt AG_FIXED_PLOTTER 3
.Os
.ds vT Agar API Reference
.ds oS Agar 1.0
.Sh NAME
.Nm AG_FixedPlotter
.Nd agar integer plot widget
.Sh SYNOPSIS
.Bd -literal
#include <agar/core.h>
#include <agar/gui.h>
.Ed
.Sh DESCRIPTION
.\" IMAGE(http://libagar.org/widgets/AG_FixedPlotter.png, "An AG_FixedPlotter widget")
.Nm
traces lines or dots over recorded integer values along a horizontal axis.
Originally designed to monitor frame rates, it can be useful for performance
monitoring in general.
.Pp
Note: For general-purpose and more advanced plotting functions,
.Xr M_Plotter 3
is available as part of the ag_math library.
.Sh INHERITANCE HIERARCHY
.Xr AG_Object 3 ->
.Xr AG_Widget 3 ->
.Nm .
.Sh INITIALIZATION
.nr nS 1
.Ft "AG_FixedPlotter *"
.Fn AG_FixedPlotterNew "AG_Widget *parent" "enum ag_fixed_plotter_type type" "Uint flags"
.Pp
.nr nS 0
The
.Fn AG_FixedPlotterNew
function allocates, initializes, and attaches a new
.Nm
widget.
The
.Fa type
argument is one of:
.Bd -literal
enum ag_fixed_plotter_type {
	AG_FIXED_PLOTTER_POINTS,   /* Dots */
	AG_FIXED_PLOTTER_LINES     /* Lines */
} type;
.Ed
.Pp
Acceptable
.Fa flags
include:
.Bl -tag -width "AG_FIXED_PLOTTER_SCROLL "
.It AG_FIXED_PLOTTER_SCROLL
Always scroll to the end of the plot if it is not visible.
.It AG_FIXED_PLOTTER_XAXIS
Display the X-axis line.
.It AG_FIXED_PLOTTER_HFILL
Expand horizontally in parent container.
.It AG_FIXED_PLOTTER_VFILL
Expand vertically in parent container.
.It AG_FIXED_PLOTTER_EXPAND
Shorthand for
.Dv AG_FIXED_PLOTTER_HFILL | AG_FIXED_PLOTTER_VFILL .
.El
.Sh PLOTTING
.nr nS 1
.Ft "AG_FixedPlotterCurve *"
.Fn AG_FixedPlotterCurve "AG_FixedPlotter *fpl" "const char *name" "Uint8 r" "Uint8 g" "Uint8 b" "Uint32 limit"
.Pp
.Ft void
.Fn AG_FixedPlotterDatum "AG_FixedPlotterCurve *curve" "AG_FixedPlotterValue val"
.Pp
.nr nS 0
The
.Fn AG_FixedPlotterCurve
function creates a new curve into
.Fa fpl .
The
.Fa r ,
.Fa g ,
.Fa b
triplet composes a color to visually identify the item.
.Fa limit
is the maximum number of points (if 0, the maximum is implicitely
.Dv INT_MAX
- 1).
.Pp
The
.Fn AG_FixedPlotterDatum
function adds a value
.Fa val
to the specified
.Fa curve .
.Sh EVENTS
The
.Nm
widget does not generate any event.
.Sh STRUCTURE DATA
For the
.Ft AG_FixedPlotter
object:
.Bl -tag -width "enum ag_fixed_plotter_type type "
.It Ft enum ag_fixed_plotter_type type
Drawing method, initially set by
.Fn AG_FixedPlotterNew .
.El
.Sh SEE ALSO
.Xr AG_Intro 3 ,
.Xr AG_Widget 3 ,
.Xr AG_Window 3
.Sh HISTORY
The
.Nm
widget first appeared in Agar 1.0.
